Repository navigation
2026 11 03 tjr spurious with patches - #449
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Repository reset uses hg shelve --cleanup, which deletes all shelves rather than only Updatebot’s shelf, risking loss of unrelated saved changes.
3 open issues
What changed in this PR
This PR updates Updatebot’s vendoring flow to detect spurious updates caused solely by removing and reapplying local patches, before creating a job or filing a bug.
Changes:
- Reapply patches temporarily and compare changes, excluding the manifest and generated files.
- Add Mercurial shelving helpers and track files added or deleted by patches.
- Add real-Mercurial regression coverage and supporting test fixtures and CI setup.
| File | Description |
|---|---|
tests/vendoring_hg/fake_mach.py |
Simulates vendoring, patch application, and post-patch scripts. |
tests/library.py |
Adds a vendor-directory fixture. |
tests/functionality_vendoring_hg.py |
Tests vendoring and cleanup with real Mercurial operations. |
tests/functionality_utilities.py |
Adds command mocks for the spurious-update check. |
test.py |
Registers the new regression suite. |
tasktypes/vendoring.py |
Detects and skips patch-only spurious updates. |
components/libraryprovider.py |
Loads vendor-directory and generated-file paths. |
components/hg.py |
Adds shelving, change detection, and patch-file staging. |
.github/workflows/ci.yml |
Installs Mercurial for Linux CI tests. |
Review effort: Balanced
9ad5793 to
1d91eef
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The generated-file metadata parsing lacks tests through validate_library for explicit and default vendor directories, leaving checkout-relative paths that control update skipping unverified.
1 open issue
3 resolved since last review
Review effort: Balanced
1d91eef to
77c3eab
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The pre-commit shelve/revert/purge flow needs validation against real Gecko manifests/actions and interrupted restoration because the harness substitutes mach and co-locates vendor and YAML directories.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
These run the vendoring flow against a real Mercurial repository, with a fake mach that behaves like mozbuild's vendoring code, so the hg operations are tested for real. They cover upstream adding, changing and deleting files and directories, our patches adding and deleting files, several patches, binary files and exec bits, post-patch scripts (keeping a source list, generating files, and failing), patches that no longer apply in various ways, and spurious updates with and without patches. Some of them fail until the next commit: updates where our patches are the only difference aren't recognised as spurious (#425), and files our patches or post-patch scripts add or delete aren't committed. Also teach the mocked functionality tests about the spurious-update check that the next commit adds, run the new tests in CI (with Mercurial installed), and expect the dav1d test library's vendor-directory.
…our patches add or delete. Fixes #425 Libraries with patches are vendored with --patch-mode none, so mach's spurious-update check always sees our patches being removed as a change, and Updatebot filed bugs for updates that, once the patches were reapplied, changed nothing. Before creating the job, save the working directory, apply the patches, and treat the update as spurious if nothing but the moz.yaml and generated files differs. Otherwise put the working directory back exactly as it was and carry on as before. `./mach vendor --patch-mode only` also doesn't register files the patches (or post-patch actions) add or delete, so committing the patches left them out (or failed with "nothing changed"). Register them first.
77c3eab to
6b08581
Compare



No description provided.